package jcommon.chap10_io;

import java.io.File;

import org.apache.commons.io.FileUtils;

public class Size {

	public static void main(String[] args) {
		System.out.println("-------- Get the size of a directory --------");
		sizeOfDirectoryDemo();
	}
	
	private static void sizeOfDirectoryDemo() {
		File file = new File(ClassLoader.getSystemResource("").getPath());
		long bytes = FileUtils.sizeOfDirectory(file);
		String display = FileUtils.byteCountToDisplaySize(bytes);
		System.out.println("  bytes: " + bytes);
		System.out.println("  size: " + display);
	}
}
